package threadDemo;

import org.junit.Test;

public class ThreadDemo11 {
    @Test
    public void test1() throws InterruptedException {
        ThreadDemo1 t1 = new ThreadDemo1("钢铁侠");
        ThreadDemo1 t2 = new ThreadDemo1("美队");
        t1.start();
        t2.start();

    }
}

class ThreadDemo1 extends Thread {
    public ThreadDemo1() {
    }
    public ThreadDemo1(String name) {
        super(name);
    }
    @Override
    public void run() {
        for (int i = 0 ; i < 100 ; i++){
            System.out.println(getId()+" "+getName()+i);
        }
    }

}
